package com.ruoyi.attendance.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.attendance.domain.Attendance;
import com.ruoyi.attendance.domain.AttendanceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface AttendanceMapper extends BaseMapper<Attendance> {

    List<Attendance> selectAttendanceList(Attendance attendance);

    int insertAttendance(Attendance attendance);

    int updateAttendance(Attendance attendance);

    int deleteAttendanceByIds(Long[] ids);

    Attendance selectAttendanceById(Long userId);

    // 修改 AttendanceMapper 接口中的方法签名
    Attendance selectAttendanceByUserIdAndDate(@Param("userId") Long userId, @Param("date") Date date);

    String getRoleTypeByUserId(Long userId);

    List<Attendance> selectAttendanceListByUserId(Long userId);

    AttendanceVO getAttendanceStats(Long userId);
}
